<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div class="box">
      <div class="box1"></div>
    </div>
    <script>
      let arr = [
        {
          confirm: 1646192,
          nation: '西班牙',
          rate: 2,
          population: 46723749
        },
        { confirm: 1621305, nation: '英国', rate: 24385, population: 66488991 },
        {
          confirm: 1585178,
          nation: '意大利',
          rate: 1,
          population: 60431283
        },
        {
          confirm: 1418807,
          nation: '阿根廷',
          rate: 3,
          population: 44494502
        },
        {
          confirm: 1308376,
          nation: '哥伦比亚',
          rate: 4,
          population: 49648685
        }
      ]
      arr.sort(function(a,b){
          return b.rate-a.rate
      })
      console.log(arr);
      let aaa=0000
    </script>
    <style>
      *{
        margin: 0;
        padding: 0;
        box-sizing: border-box;
      }
      .box{
        background-color: #f90;
        border: 1px solid transparent;
      }
      .box1{
        height: 100px;
        width: 100px;
        padding: 10px;
        background-color: #999;
        margin: 350px auto;
      }
    </style>
  </body>
</html>
